import asyncRouter from "../utils/asyncRouter";
// 路由懒加载
const Layout = asyncRouter(() => import("../pages/layout"));
const Classify = asyncRouter(() => import("../pages/classify"));
const Cart = asyncRouter(() => import("../pages/cart"));
const Detail = asyncRouter(() => import("../pages/detail"));

export const routes = [
	{
		from: "/",
		to: "/layout",
	},
	{
		path: "/layout",
		component: Layout,
		children: [
			{
				from: "/layout",
				to: "/layout/classify",
			},
			{
				path: "/layout/classify",
				component: Classify,
			},
			{
				path: "/layout/cart",
				component: Cart,
			},
		],
	},
	{
		path: "/detail/:id",
		component: Detail,
	},
];
